export default {
	state: {
		userInfo: { // 用户信息窗口
			show: false,
			user: {},
			pos:{
				x:0,
				y:0
			},
			adminSet: false,//状态：是否可以设置为管理员，
			cancleAdmin:false,//状态：取消管理员按钮
			groupChat:false,//标注位置位于群聊
			groupId:""
		},
		fullImage: { // 全屏大图
			show: false,
			url: ""
		},
		flushGroup:{//A页面通过vuex 刷新B页面的 群组成员
			toFlush:false
		},
	},
	mutations: {
		//设置群聊成员刷新
		setFlushGroup(state,flushFlag){
			state.flushGroup.toFlush = flushFlag;
		},
		//设置用户所属的群Id
		setGroupId(state,groupId){
			state.userInfo.groupId=groupId;
		},
		//按钮位置标识，是否是从群聊中点击的头像
		groupChat(state,groupChat){
			state.userInfo.groupChat=groupChat;
		},
		//显示按钮：可以设置为管理员按钮
		cancleAdmin(state,status){
			state.userInfo.cancleAdmin=status;
		},
		//显示按钮：可以设置为管理员按钮
		showAdminSet(state){
			state.userInfo.adminSet=true;
		},
		//隐藏按钮：可以设置为管理员按钮
		closeAdminSet(state){
			state.userInfo.adminSet=false;
		},
		showUserInfoBox(state,user){
			state.userInfo.show = true;
			state.userInfo.user = user;

		},
		setUserInfoBoxPos(state,pos){
			let w =  document.documentElement.clientWidth;
			let h =  document.documentElement.clientHeight;
			state.userInfo.pos.x = Math.min(pos.x,w-350);
			state.userInfo.pos.y = Math.min(pos.y,h-200);
		},
		closeUserInfoBox(state){
			state.userInfo.show = false;
		},
		showFullImageBox(state,url){
			state.fullImage.show = true;
			state.fullImage.url = url;
		},
		closeFullImageBox(state){
			state.fullImage.show = false;
		}
	}
}
